//
//  BaseTableViewController.swift
//  Weibo
//
//  Created by mac on 16/1/13.
//  Copyright © 2016年 itcast. All rights reserved.
//

import UIKit

class BaseTableViewController: UITableViewController, VisitorLoginViewDelegate {
 
    var userLogin = false
    
    var visitroLoginView: VisitorLoginView?
    
    override func loadView() {
        if userLogin {
            super.loadView()
        } else {
            visitroLoginView = VisitorLoginView()
            visitroLoginView?.visitorViewDelegate = self
            view = visitroLoginView
        }
    }
    
    func userWillRegister() {
        print(__FUNCTION__)
    }
    
    func userWillLogin() {
        print(__FUNCTION__)
        let oauth = OAuthViewController()
        presentViewController(oauth, animated: true, completion: nil)
    }
    
    override func viewWillLayoutSubviews() {
        super.viewWillLayoutSubviews()
        
        print(view)
        print(view.classForCoder)
    }
    override func viewDidLoad() {
        super.viewDidLoad()
        

    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }


}
